#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
const ll N = 1e7 + 5;
const ll mod = 1e9 + 7;
ll phi[N], s[N], cnt, vis[N], prim[N];

// 欧拉线性模版
void init() {
    phi[1] = 1;
    for (int i = 2; i <= N; i++) {
        if (!vis[i]) {
            phi[i] = i - 1;
            prim[++cnt] = i;
        }
        for (int j = 1; j <= cnt; j++) {
            int tp = prim[j];
            if (i * tp > N) break;
            vis[i * tp] = true;
            if (i % tp == 0) {
                phi[i * tp] = phi[i] * tp; break;
            } else phi[i * tp] = phi[i] * phi[tp];
        }

    }
    s[1] = phi[1];
    for (int i = 2; i < N; i++) {
        s[i] = s[i - 1] + 2 * phi[i];
    }
    
}
int main() {
    int n;
    init();
    cin >> n;
    ll ans = 0;
    for (int i = 1; i <= n; i++) {
        ans = (ans + s[n / i] * i % mod * i % mod) % mod;
    }
    cout << ans << endl;
    return 0;

}